package com.w.wx.controller;

import com.w.wx.domain.Msg;
import com.w.wx.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wx/lt")
public class InfoNoticeContro {
    @Autowired
    private ChatService chatService;

    /**
     * 返回当前用户未读消息列表
     * @param openid
     * @return
     */
    @RequestMapping("list")
    public Msg getUserInfoList(String openid){
        return chatService.getUserInfoList(openid);
    }

    /**
     * type:0为获取评论通知，1为获取点赞通知
     * @param openid
     * @param type
     * @return
     */
    @RequestMapping("getNoticeInfo")
    public Msg getCommentsNotice(String openid,Integer type){
       return chatService.getNotice(openid,type);
    }
    /**
     * type:0为删除评论通知，1为删除点赞通知
     * @param openid
     * @param type
     * @return
     */
    @RequestMapping("haveRead")
    public Msg deleteCommentsNotice(String openid,Integer type){
        return chatService.deleteCommentsNotice(openid,type);
    }

    @RequestMapping("deleteList1")
    public Msg deleteList1(String myOpenid,String beDeleteOpenid){
        return chatService.deleteList1(myOpenid,beDeleteOpenid);
    }

}
